package com.gec.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.gec.dao.ProductDao;
import com.gec.entity.Product;

@WebServlet("/ProductInfoServlet")
public class ProductInfoServlet extends HttpServlet {
	
	
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  	    //先获取商品的编号
  	    String pid = request.getParameter("pid");
  	    ProductDao productDao = new ProductDao();
  	    Product product = productDao.getProductByPid(pid);
  	    request.setAttribute("product", product);
  	    request.getRequestDispatcher("product_info.jsp").forward(request, response);
  	}
	
	

		
}